package cn.lingyangwl.agile.system.assembly;

import cn.lingyangwl.agile.system.model.entity.SysRoleMenu;
import cn.lingyangwl.agile.system.model.rqrs.ram.ResourcePermResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author shenguangyang
 */
@Mapper(componentModel = "spring")
public interface AuthorizeAssembly {
    @Mappings({
            @Mapping(source = "roleId", target = "subjectId"),
            @Mapping(source = "menuId", target = "resourceId"),
            @Mapping(source = "resourceAction", target = "action")
    })
    ResourcePermResp toResourcePermResp(SysRoleMenu source);
}
